package com.inifitness.admin.core.system.converter;

import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.inifitness.admin.core.system.model.dto.EventDTO;
import com.inifitness.admin.core.system.model.entity.SysEvent;
import com.inifitness.admin.core.system.model.form.EventForm;
import com.inifitness.admin.core.system.model.vo.EventPageVO;
import com.inifitness.common.model.Option;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 系统管理-事件信息转换类
 *
 * @author
 * @since 2024-05-31 13:45:02
 */

@Mapper(componentModel = "spring")
public interface EventConvert {

  EventPageVO bo2Vo(SysEvent bo);

  Page<EventPageVO> entity2Page(Page<SysEvent> page);

  @Mapping(target = "value", source = "id")
  @Mapping(target = "label", source = "name")
  Option<Long> entity2Option(SysEvent entity);

  List<Option<Long>> entities2Options(List<SysEvent> entities);

  SysEvent form2Entity(EventForm form);

  EventForm entity2Form(SysEvent entity);

  EventDTO entity2dto(SysEvent entity);
}
